package com.szml.user.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author limin
 * @date 2025-06-20 20:06
 * @description
 */
@FeignClient(name = "permission-service",path = "/permission")
public interface PermissionServiceClient {
    // 绑定默认角色（普通用户）
    @PostMapping("/bindDefaultRole")
    void bindDefaultRole(@RequestParam("userId") Long userId);

    // 查询用户角色码（返回role_code）
    @GetMapping("/getUserRoleCode")
    String getUserRoleCode(@RequestParam("userId") Long userId);

    // 超管调用：升级用户为管理员
    @PostMapping("/upgradeToAdmin")
    void upgradeToAdmin(@RequestParam("userId")Long userId);

    // 超管调用：降级用户为普通角色
    @PostMapping("/downgradeToUser")
    void downgradeToUser(@RequestParam("userId")Long userId);


}
